from faker import Faker
from openpyxl import Workbook
import random

random.seed(42)
wb = Workbook()
ws = wb.active
ws.title = "Data"
ws.append(["邮箱", "姓名", "地址", "电话号码"])


def generate_cn_email(fake):
    user_name = fake.user_name()
    domain = "git.cn"
    return f"{user_name}@{domain}"


faker = Faker(['zh_CN', 'en_us', 'ja_jp'])
for i in range(100):
    email = generate_cn_email(faker)
    name = faker.name()
    address = faker.address()
    phone_number = faker.phone_number()

    ws.append([email, name, address, phone_number])


wb.save("faker100.xlsx")
print('保存成功')